package gamagora.game.entity
{
	import gamagora.game.resources.OSImages;

	public class OSTrain extends OSEntity
	{
		public function OSTrain(X:Number=0, Y:Number=0, special:Boolean = false)
		{
			super(NOTHING, X, Y, OSImages.TRAIN);
			offset.y = 20;
			
			//Up
			var ground:OSGround = new OSGround(X + 22, Y + 15 - offset.y, special ? 280 : 394, special ? 70 : 20, 0, false, false);
			ground.hide = true;
			add(ground);
			
			//Right
			ground = new OSGround(X + 396, Y + 35 - offset.y, 20, special ? 100 : 164, 0, false);
			ground.hide = true;
			add(ground);
		
			//Down
			ground = new OSGround(X + 22, Y + 199 - offset.y, 394, 20, 0, false, false); 
			ground.hide = true;
			add(ground);
		
			//Left
			ground = new OSGround(X + 22, Y + 35 - offset.y,special ? 40 : 20, 164, 0, false, !special);
			ground.hide = true;
			add(ground);
			
			if(special)
			{
				var trapdoor:OSEntity = new OSEntity(NOTHING, X + 380, Y - 26);
				trapdoor.makeGraphic(60, 5, 0xff000000);
				trapdoor.angle = -45;
				add(trapdoor);
			}
		
		}
	}
}
